.form-control {
  height: $input-height-base;
  padding-left: $input-padding-horizontal;
  padding-right: $input-padding-horizontal;
  border-radius: 0;
  font-size: $input-font-size-base;
  font-weight: 500;
  color: $input-color-base;
  border-color: $input-border-color-base;
  background-color: $input-bg-base;
  box-shadow: none;

  &:focus {
    border-color: $input-border-color-active;
    box-shadow: none;
  }

  &--grey {
    background-color: $input-bg-grey;
  }

  &:placeholder {
    color: #949494;
    font-size: $input-font-size-base - 1;
    font-weight: 400;
  }
}

.valid .form-control,
.form-control[readonly],
.form-control--valid {
  color: $input-color-valid;
  border-color: $input-border-color-valid;
  background-color: $input-bg-valid;
}

.form-control[readonly] {
  cursor: not-allowed;
}

.has-error {
  .form-control {
    &, &:focus {
      color: $input-color-error;
      border-color: $input-border-color-error;
      box-shadow: none;
    }
  }

  .help-block {
    color: $input-color-help-error;
    font-size: $input-font-size-hlep;
  }
}

input[type="checkbox"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: $checkbox-size;
  height: $checkbox-size;
  border: 0;
  background: url('~images/icons/checkbox-unchecked.png') left top 100% no-repeat;
  cursor: pointer;

  &:focus {
    outline: 0;
  }

  &:checked {
    background-image: url('~images/icons/checkbox-checked.png');
  }
}

.checkbox {

  label {
    padding-left: $checkbox-size + 10px;
  }

  input[type="checkbox"] {
    margin-left: -28px;
    top: -2px;
  }
}

.form {
  &__juxtapose {

    .form-group {
      margin-left: 0;
      margin-right: 0;
      overflow: hidden;

      &__addon {
        padding-left: 14px;
        overflow: hidden;
      }

      &__single {
        padding-left: 178px;
      }
    }

    .control-label {
      float: left;
      min-width: 160px;
      margin-right: 18px;
      padding-top: 10px;
    }

  }

  &__label {
    position: relative;
    margin-bottom: 10px;
    font-size: $form-label-font-size;
    color: $form-label-color-base;
    font-weight: 400;
    line-height: 1;

    &--require:before {
      position: absolute;
      content: '*';
      color: $form-label-color-danger;
      left: -8px;
      top: -1px;
    }
  }

  &__verification {
    overflow: hidden;

    > .form-control {
      float: left;
      width: 50%;
      margin-right: 22px;
    }
  }
}

.toggle {
  display: inline-block;
  vertical-align: middle;
  transition: .15s transform ease;

  &, &__switch {
    position: relative;
    width: $toggle-width;
    height: $toggle-height;
    margin: 0;
    padding: 0;
    border-radius: 16px;
    cursor: pointer;
    overflow: hidden;
  }

  &__switch {
    display: block;
    background-color: $toggle-bg-success;

    &:before, &:after {
      position: absolute;
      content: '';
    }

    &:before {
      width: $toggle-width;
      height: $toggle-height;
      background-color: $toggle-bg-base;
      transition: .15s;
      transform: scale(1);
    }

    .switch {

      &__inner {
        position: absolute;
        height: $toggle-height;
        width: $toggle-label-size * 2 + $toggle-handle-size;
        top: 0;
        left: 5px;
        transition: .15s;
        transform: translate(0, 0);
      }

      &__on, &__off {
        float: left;
        width: $toggle-label-size;
        height: $toggle-height;
        color: $toggle-label-color-base;
        font-size: $toggle-label-font-size;
        line-height: $toggle-height;
        font-weight: 400;
      }

      &__on {
        padding-left: $toggle-label-padding-horizontal;
        text-align: left;
      }

      &__off {
        padding-right: $toggle-label-padding-horizontal;
        text-align: right;
      }

      &__handle {
        float: left;
        width: $toggle-handle-size;
        height: $toggle-handle-size;
        border-radius: $toggle-handle-size;
        margin-top: $toggle-handle-margin-vertical;
        background-color: $toggle-color-base;
      }

    }
  }

  > [type="checkbox"] {
    display: none;

    &:checked {
      + .toggle__switch {

        &:before {
          transform: scale(0);
        }

        .switch__inner {
          transform: translate(-30px, 0);
        }

      }
    }
  }

}

.input-suite {
  display: table;

  &__addon, .form-control {
    display: table-cell;
    vertical-align: middle;
  }

  .form-control {
    width: 100%;
  }

  &__addon {
    width: 1%;
    padding: 0 10px;
    white-space: nowrap;

    &:first-child {
      padding-left: 0;
    }

    &:last-child {
      padding-right: 0;
    }
  }

  &.align-bottom {
    .input-suite__addon {
      padding-left: 20px;
      vertical-align: bottom;
    }
  }
}
